<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>申请</title>
        <%-- 全站样式 --%>
        <jsp:include page="/WEB-INF/jsps/template_style.jsp"></jsp:include>
    
    </head>
	<!-- 显示返回信息 -->
	<c:if test="${!empty message }">
		<script type="text/javascript">
			alert("${message}");
		</script>
	</c:if>
    <body class="page-body skin-navy">
        <div class="page-container">
           	<%--侧边栏 --%>
			<jsp:include page="/WEB-INF/jsps/sidebar.jsp"></jsp:include>
			
            <div class="main-content">
               	<%--导航栏 --%>
				<jsp:include page="/WEB-INF/jsps/navbar.jsp"></jsp:include>
                <div class="row">
                    <div class="tabs-vertical-env">
                        
                        <div class="tab-content">
                            <p class="col-md-offset-5">如需修改个人信息请到修改信息页面<a href="<c:url value="displayUserInfo.do?count=1"/>">修改个人信息页面</a></p>
                            <div class="tab-pane active" id="v-home">
                                <div class="panel-body">
                                  <c:forEach items="${data }" var="user">
                                    <form class="form-horizontal" onsubmit="return submitForm();" action="<c:url value="/upload/roleApplication.do"/>" method="post" enctype="multipart/form-data">
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label" for="field-1">真实姓名</label>
                                            <div class="col-sm-10">
                                                <input type="text" class="form-control" id="field-1" placeholder=" ${user['name'] }" disabled>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label" for="field-1">邮箱</label>
                                            <div class="col-sm-10">
                                                <input type="text" class="form-control" id="field-1" placeholder=" ${user['email'] }" disabled>
                                            </div>
                                        </div>
                                        <div class="form-group-separator"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label" for="field-2">身份证</label>
                                            <div class="col-sm-10">
                                                <input type="password" class="form-control" id="field-2" placeholder="${user['IdCard'] }" disabled>
                                            </div>
                                        </div>
                                        <div class="form-group-separator"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">申请角色</label>
                                            <div class="col-sm-10">
                                                
                                                <select class="form-control" name="roleID">
	                                               <c:choose>
	                                                <c:when test="${user['roleID']==2 }">
	                                                  	<option value="3">实验人员</option>
	                                                 </c:when>
	                                                 <c:otherwise>
	                                                 	<option value="3">实验人员</option>
	                                                  	<option value="2">操作人员</option>
	                                                  </c:otherwise>  
	                                                </c:choose>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group-separator"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label" for="field-3">手机号码</label>
                                            <div class="col-sm-10">
                                                <input type="text" class="form-control" id="field-3" placeholder="${user['phoneNumber'] }" disabled>
                                            </div>
                                        </div>
                                        <div class="form-group-separator"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label" for="field-4">身份文件</label>

                                            <div class="col-sm-10">
                                                <input type="file" name="fileUrl" value="" class="col-sm-8" required/>
                                            </div>
                                        </div>
                                        <div class="form-group-separator"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label" for="field-5">工作地址</label>
                                            <div class="col-sm-10">
                                                <input class="form-control autogrow"  id="field-5" placeholder="${user['workAddress'] }" disabled></textarea>
                                            </div>
                                        </div>
                                        <div class="form-group-separator"></div>
                                        <div class="form-group">
                                        	<label class="col-sm-2 control-label" for="field-6">个人地址</label>
                                            <div class="col-sm-10">
                                                <input type="text" class="form-control" id="field-6" placeholder="${user['personAddress'][0] }${user['personAddress'][1] }${user['personAddress'][2] }${user['personAddress'][3] }" disabled>
                                            </div>
                                           
                                        </div>
                                        <div class="form-group-separator"></div>
                                        
                                   
                                   </c:forEach>
                                </div>
                                <div class="form-group">
                                    <!--<button type="button" class="btn btn-gray btn-single">取消</button>-->
                                    <button type="submit" class="btn btn-info btn-single pull-right" onclick="SendForm();">确定</button>
                                </div>
                                 </form>
                            </div>
                            <div class="tab-pane" id="v-profile">
                            </div>
                            <div class="tab-pane" id="v-messages">
                                <p>When be draw drew ye. Defective in do recommend suffering. House it seven in spoil tiled court. Sister others marked fat missed did out use. Alteration possession dispatched collecting instrument travelling he or on. Snug give made at spot or late that mr. </p>
                            </div>
                            <div class="tab-pane" id="v-settings">
                                <p>Luckily friends do ashamed to do suppose. Tried meant mr smile so. Exquisite behaviour as to middleton perfectly. Chicken no wishing waiting am. Say concerns dwelling graceful six humoured. Whether mr up savings talking an. Active mutual nor father mother exeter change six did all. </p>
                            </div>
                        </div>
                    </div>
                </div>
                
				<%--页脚 --%>
				<jsp:include page="/WEB-INF/jsps/footer.jsp"></jsp:include>
            </div>
        </div>

        <div class="page-loading-overlay">
            <div class="loader-2"></div>
        </div>

        
		<%-- 尾部内容 --%>
		<jsp:include page="/WEB-INF/jsps/template_tail.jsp" />
        <!--Specific JS for this page-->
        <script type="text/javascript">
            jQuery(document).ready(function($) {});
            function SendForm() {//
    			if (submitForm()) {
    				document.addForm.submit();
    			}
    		}
            function submitForm(){
            	 var filepath = $("input[name='fileUrl']").val();
                 var extStart = filepath.lastIndexOf(".");
                 var ext = filepath.substring(extStart, filepath.length).toUpperCase();
                 if (ext != ".BMP" && ext != ".PNG" && ext != ".JPG" && ext != ".JPEG" && ext != ".TXT") {
                     alert("图片限于bmp,png,gif,jpeg,jpg,TXT格式");
                     return false;
                 } 
                 var file_size = 0;
                 if ($.browser.msie) {
                     var img = new Image();
                     img.src = filepath;
                     while (true) {
                         if (img.fileSize > 0) {
                             if (img.fileSize > 10 * 1024 * 1024) {
                                 alert("图片不大于10MB。");
                             } 
                             break;
                         }
                     }
                 } else {
                     file_size = this.files[0].size;
                     var size = file_size / 1024;
                     if (size > 10240) {
                         alert("上传的图片大小不能超过10M！");
                     } 
                 }
                 return true;
            }
        </script>
    </body>

</html>